<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>正则表达式</title>
	</head>
	<body>
		<script>
			var str='Abc123abc456';
			
			var reg1=/abc/;
			var reg2=/abc/i;
			var reg3=/abc/gi
			
			console.log(reg1.exec(str));
			console.log(reg2.exec(str));
			console.log(reg3.exec(str));
			
			console.log(str.match(reg1));
			console.log(str.match(reg2));
			console.log(str.match(reg3));
			
			
			var r1=/^abc/gi;
			var r2=/abc$/gi;
			
			console.log(str.match(r1));
			console.log(str.match(r2));
			
			
			var str1='good idea';
			var reg=/\s../gi;
			console.log(str1.match(reg));
		</script>
	</body>
</html>
